﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ZP.Common;
using ZP.DTO.Common;
using ZP.DTO.fz_sys_menu;
using ZP.IBLL;
using ZP.Model;

namespace ZCSBZPJ.Controllers
{
    public class HomeController : BaseController
    {
        //public HomeController(Ifz_sys_userService _fz_sys_userService, Ifz_sys_menuService _fz_sys_menuService)
        //{
        //    this._fz_sys_menuService = _fz_sys_menuService;
        //    this._fz_sys_userService = _fz_sys_userService;
        //}

        public ActionResult Main()
        {
            return View();
        }
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult TopPage()
        {
            return View();
        }

        public ActionResult LeftPage()
        {
            List<fz_sys_menuResultDTO> result = new List<fz_sys_menuResultDTO>();
            if (Session[ZPCommon.SESSION_Login] != null)
            {
                UserLoginDTO loginUser = (UserLoginDTO)Session[ZPCommon.SESSION_Login];
                List<int> menuIds = loginUser.CurrentUserAuthorityList.Select(s => s.id).ToList();
                result = _fz_sys_menuService.GetSysMenuByRoleId(loginUser.roleId, menuIds).ToList();
            }
            //List<UserLoginDTO.CurrentUserAuthority> result = new List<UserLoginDTO.CurrentUserAuthority>();
            //if (Session[ZPCommon.SESSION_Login] != null)
            //{
            //    UserLoginDTO loginUser = (UserLoginDTO)Session[ZPCommon.SESSION_Login];
            //    result = loginUser.CurrentUserAuthorityList;
            //}
            return View(result);
        }


    }
}